import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-warehouse/checking/page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const add = (row) => {
    return request({
        url: '/api/mes-warehouse/checking/submit',
        method: 'post',
        data: row
    });
};

export const getPartByArea = (row) => {
    return request({
        url: '/api/mes-warehouse/packing/material-list',
        method: 'post',
        data: row
    });
};

export const getCheckMaterialList = (planId) => {
    return request({
        url: '/api/mes-warehouse/checking/checking-material/list',
        method: 'get',
        params: {
            planId
        }
    });
};

export const getCheckMaterialPage = (current, size, params) => {
    return request({
        url: '/api/mes-warehouse/checking/checking-material/material-page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const remove = (ids) => {
    return request({
        url: '/api/mes-warehouse/checking/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

export const checkCancel = (ids) => {
    return request({
        url: '/api/mes-warehouse/checking/cancel',
        method: 'post',
        params: {
            ids
        }
    });
};

export const checkCompleted = (ids) => {
    return request({
        url: '/api/mes-warehouse/checking/completed',
        method: 'post',
        params: {
            ids
        }
    });
};

export const checkEnable = (ids) => {
    return request({
        url: '/api/mes-warehouse/checking/enable',
        method: 'post',
        params: {
            ids
        }
    });
};

export const checkPrint = (params) => {
    return request({
        url: '/api/mes-warehouse/checking/print',
        method: 'post',
        params: params
    });
};

export const getInventoryInfo = (current, size, params) => {
    return request({
        url: '/api/mes-admin/area/page/storage/management',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};
export const getSubTypeList = (params) => {
    return request({
        url: '/api/mes-admin/area/get-level-by-inventory',
        method: 'get',
        params: {
            ...params,
        }
    });
};